package com.czxy.servlet;


import cn.itcast.servlet.BaseServlet;
import com.czxy.domain.User;
import com.czxy.service.UserService;

import javax.servlet.annotation.WebServlet;
import java.util.List;

@WebServlet("/userServlet")
public class UserServlet extends BaseServlet {


    public String findAll(){

        UserService userService = new UserService();
        List<User> list = userService.findAll();
        getRequest().setAttribute("list", list);
        return "show.jsp";



    }


    public String findUserAllInfoByUid(){

        String uid = getRequest().getParameter("uid");
        UserService userService = new UserService();
        User user = userService.findUserAllInfoByUid(Integer.parseInt(uid));
        getRequest().setAttribute("user", user);
        return "show.jsp";
    }
}
